<?php


namespace app\index\controller;

use app\index\model\Banner as BannerModel;
use think\Request;
use app\index\model\Cases as CasesModel;
use app\index\model\Ip as IpModel;
use app\index\model\Brand as BrandModel;
use app\index\model\Data as DataModel;
use app\index\model\Shop as ShopModel;

class Cases extends BaseController
{
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $banner = BannerModel::getBanner('case');
        $action = $request->action();
        $this->assign('banner', $banner);
        $this->assign('action', $action);
    }

    public function all()
    {
        $cases = CasesModel::getByOnline();

        $this->assign('cases', $cases);
        return $this->fetch();
    }

    public function brand()
    {
        $brands = BrandModel::getByOnline();

        $this->assign('brands', $brands);
        return $this->fetch();
    }

    public function ip()
    {
        $ips = IpModel::getByOnline();

        $this->assign('ips', $ips);
        return $this->fetch();
    }

    public function data()
    {
        $datas = DataModel::getByOnline();

        $this->assign('datas', $datas);
        return $this->fetch();
    }

    public function shop()
    {
        $shops = ShopModel::getByOnline();

        $this->assign('shops', $shops);
        return $this->fetch();
    }

}